Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: [EAPQE-2410] Add test to verify AJP Listener allowed-request-attributes-pattern #120

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

istraka
Copy link

@istraka istraka commented Oct 9, 2024

The feature is in preview mode, waiting on https://issues.redhat.com/browse/WFLY-19808

Anyway, test is ready for a review, if you want to run it, configure container to start with -Djboss.stability=preview

};

before(() => {
cy.startWildflyContainer()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

startWildflyContainer could be extended to accept parameters for standalone.sh, so that the test could be executed for the preview level.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you could define optional additional start parameter to: https://github.com/istraka/berg/blob/EAPQE-2410/packages/testsuite/cypress.config.ts#L19

and here just use it (additionalStartParameter="--stability=preview")

what do you think @OndrejKotek @istraka?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OndrejKotek added. I didn't add the parameter to the task, because I assume I would have to modify tests (setting the parameter). Now I control it via environment variable.

Copy link
Collaborator

@kstekovi kstekovi Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@istraka i don't like this approach for two reasons. You have to edit job automation and you don't see the test require a preview mode. could you please introduce a new parameter which you will define when the server is stared.

You can find inspiration in hostMode implemented for OIDC. This is almost same case.

https://github.com/hal/berg/blob/main/packages/testsuite/cypress/e2e/elytron-oidc-client/test-oidc-security-configure-oidc.cy.ts#L62

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC this solution would always start wildfly in preview stability mode. However we want to test the feature NOT in preview mode (in the future). With the proposed solution we wouldn't check default one, which we intend to do so. Once WFLY-19808 is resolved I would have to submit yet another PR. I'd like to keep it to 1:)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My question is: do we want to have tests in the TS that runs in preview mode? And what if they are promoted to higher stability level? Should the test change?

Copy link
Collaborator

@kstekovi kstekovi Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC this solution would always start wildfly in preview stability mode

I don't think. You can define the default value to false and only in your case you can set it to true. so only your test you will start server in preview mode.

Like in case hostMode. Default value is network mode so when you will not use any parameter it will started in network mode. And only OIDC test define the parameter useNetworkHostMode: true so only when the parameter is present then the server will start a server in hostMode.

However we want to test the feature NOT in preview mode (in the future)

When this will be changed there have to be some JIRA to track this change. Because the documentation have to be also update etc. So also these test have to update to remove the parameter for preview mode.

Now you still adding the required subsystem manually and when it will be promoted to regular feature you will have to remove this manual configuration.

You will have to update a tests in every case. So why not to do property and explicitly define the preview mode is active?

do we want to have tests in the TS that runs in preview mode? And what if they are promoted to higher stability level? Should the test change?

No we wont start server in preview mode only for your test.

And what if they are promoted to higher stability level? Should the test change?

Only the parameter from your test will be removed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am afraid of forgotten test running in preview stability mode. We have discussed this and agreed we should not do that and I'd like to wait with this PR for WFLY-19808.

We are waiting for the feature to be promoted to the default stability level WFLY-19808. EAP7-1836 is blocked by EAPDOC-2314.

IIUC we need the RFE to be in a sprint for WFLY-19808. But Bartosz has submitted the MR, and if it gets merged....well, we can merge this.

};

before(() => {
cy.startWildflyContainer()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you could define optional additional start parameter to: https://github.com/istraka/berg/blob/EAPQE-2410/packages/testsuite/cypress.config.ts#L19

and here just use it (additionalStartParameter="--stability=preview")

what do you think @OndrejKotek @istraka?

cy.get(serverSelectors.ajpListenerItem).click();
});

it("Test AJP Listener: allowed request attributes pattern", () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do test also negatived scenario? When is no possible to define AJP_ALLOWED_REQUEST_ATTRIBUTES_PATTERN

What a user see and what happened when a preview mode is not allowed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a preview mode is not allowed, the parameter is simply not there. However it should be visible all the time - once it is in default stability level.

I guess there is no negative scenario - it is a pattern. Only invalid value is invalid patter (i.e. (.*), but this is parsed during service startup (after you click on the reload) and the WEB UI doesn't check it. Same for the CLI op - it fails to laod after the reload.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be a negative scenarios when a user fill a wrong expression.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would you expect in such case?

Copy link
Collaborator

@kstekovi kstekovi Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. You are working on the RFE and you should know how does it behave when it is wrongly configured.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect some notification which say the expression is wrong.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As i understand. You can configure a wrong expression without any warning then restart a server and then it will not start again. So you have a dead server which you can't reconfigure back because it is offline now. So you have to manually update the standalone.xml to revert you last change.

I don't know if it is possible to check it in advance. I am just asking.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have discussed this offline. Reload produce an error - the service won't start because of wrong expression. Console is still up and you can edit the expression (CLI or Web console).

@istraka istraka force-pushed the EAPQE-2410 branch 2 times, most recently from f9e24d6 to 071d8bf Compare October 9, 2024 17:45
@istraka istraka changed the title [EAPQE-2410] :Add test to verify AJP Listener allowed-request-attributes-pattern DRAFT: [EAPQE-2410] Add test to verify AJP Listener allowed-request-attributes-pattern Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants